package IMIC.NGUYENVANTINH.OOP.LEVEL2.EX1;

import java.text.DecimalFormat;

public class Views {
	public static void main(String[] args) {
		DecimalFormat df2 = new DecimalFormat("#.###");
		//Khoi tao triangleEntity khong tham so su dung constructor mac dinh
		TriangleEntity mData = new TriangleEntity();
		//Khoi tao controllers
		Controllers objContrl = new Controllers();
		System.out.println("Infor Triangle");
		//Hien thi thong tin Triangle
		System.out.println(mData.toString());
		//uy quyen tinh dien tich cho Controller
		double A = objContrl.CanculatorArea(mData);
		System.out.println("Area is:" + df2.format(A));
		//Uy quyen tinh chu vi cho Controller xu ly.
		System.out.println("Perimeter:"+df2.format(Math.round(objContrl.CanculatorPerimeter(mData)*100.0)/100.0));
		//Khoi tao Triangle
		TriangleEntity mData1 = new TriangleEntity(23.45,17,36);
		System.out.println("Infor Triangle");
		//Hien thi thong tin Triangle
		System.out.println(mData1.toString());
		//uy quyen tinh dien tich cho Controller
		System.out.println("Area is:" + df2.format(objContrl.CanculatorArea(mData1)));
		//Uy quyen tinh chu vi cho Controller xu ly.
		System.out.println("Perimeter:"+Math.round(objContrl.CanculatorPerimeter(mData1)*100.0)/100.0);
		

	}

}
